<?php

namespace App\Http\Controllers\Web;

use App\Http\Controllers\Controller;
use App\Services\ProtocolService;
use Illuminate\Http\Request;
use YQ\YqExtend;

class PolicyController extends Controller
{
    public function index(Request $request, $game_id)
    {
        $channel = $request->input('channel');
        $device_num = $request->input('device_num');
        if (!$device_num) {
            $device_num = YqExtend::uniqid32();
        }
        return view('policy.index', [
            'game_id'     => $game_id,
            'channel'     => $channel,
            'device_num'  => $device_num,
            'user_url'    => ProtocolService::getInstance()->getUserUrl($game_id),
            'privacy_url' => ProtocolService::getInstance()->getPrivacyUrl($game_id),
        ]);
    }
}
